package com.suray.basic.wcs.plc.enums;

/**
 * @author shaozn
 * @date 2020/2/26 - 8:53
 * @Description 提升机模式控制
 */
public enum LifterMode {
    /**
     * 托盘出入
     */
    LOAD_PALLET(1),
    /**
     * 载车
     */
    LOAD_RGV(2),
    /**
     * 空载
     */
    UNLOADED(3),
    /**
     * 调试
     */
    DEBUG(4),

    /**
     * 两向车
     */
    TWO_DIRECTION_RGV(5),
    /**
     * 四向车模式
     */
    RGV(6);


    private int modeNum;

    LifterMode(int modeNum) {
        this.modeNum = modeNum;
    }

    public static LifterMode parseMode(int status) {
        LifterMode[] lifterModes = LifterMode.values();
        for (LifterMode lifterMode : lifterModes) {
            if (lifterMode.getModeNum() == status) {
                return lifterMode;
            }
        }
        throw new IllegalArgumentException("提升机模式参数错误");
    }

    public int getModeNum() {
        return modeNum;
    }
}
